package GetMoneyUser;

import java.util.ArrayList;
import java.util.Random;

public class Member extends User {
    public Member() {
    }

    public Member(String name, int money) {
        super(name, money);//父类的构造器
    }
    public  void receive(ArrayList<Integer> list)
    {
        //?? 随机值
        int index = new Random().nextInt(list.size());
        //1.拿到的红包
        Integer remove = list.remove(index);
        //2.获取原来的余额
        int money = super.getMoney();
        //3.收到红包之后的余额
        super.setMoney(money+remove);

    }
}